package com.naiterui.ehp.bs.emr.repository.mongo;

import java.util.Collection;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseMongoRepository;
import com.naiterui.ehp.bs.emr.entity.mongo.PatientDisease;


/**
 * @author wangzehao
 * @date 2018/10/16 2:01 PM
 * @since 1.0.0
 */
@Repository
public interface PatientDiseaseRepository extends BaseMongoRepository<PatientDisease, String> {

    PatientDisease findFirstByPatientIdAndDoctorIdOrderByCreateAtDesc(Long patientId, Long doctorId);

    PatientDisease findFirstByPatientIdOrderByCreateAtDesc(Long patientId);
	
    Page<PatientDisease> findByPatientId(Long patientId, Pageable pageable);

    List<PatientDisease> findAllByIdIn(Collection<String> ids);
}
